define(function (require, exports, module) {
    var sTpl = require("modules/cube-collection/index.html");

    require("components/card/index.js");
    require("modules/cube-basic-info/index.js");
    require("modules/cube-props/index.js");
    require("modules/cube-methods/index.js");
    require("modules/cube-api-list/index.js");
    require("modules/cube-list/index.js");

    var vueComponent = Vue.extend({
        template: sTpl,
        props: {
            curCubeId: {}
        },
        data: function () {
            return {
                curCubeId: '',
                title_01: '组件信息(暂简单展示数据库字段)',
                title_01_collapse: true,
                title_02_show: false,
                title_03_show: false,
                title_04_show: false,
                title_05_show: false,
                title_02: '参数',
                title_03: '方法',
                title_04: '关联服务',
                title_05: '关联组件'
            }
        },
        methods: {
            toggleShow_01: function () {
                alert("卡片自动完成折叠切换, 完成后向上外送通知!亲,我是外层,收到组件内变化通知");
            }
        },
        created: function () {
            this.curCubeId = parseInt(this.$route.params.curCubeId) || 0;

            var collapse_cube_id_arr = ['1101', '1102', '1103', '1104', '1105'];


            var map = require("config/api.js");


            if (map["cube_props"] && map["cube_props"][this.curCubeId] && map["cube_props"][this.curCubeId].length > 0) {
                this.title_02_show = true;
            }

            if (map["cube_methods"] && map["cube_methods"][this.curCubeId] && map["cube_methods"][this.curCubeId].length > 0) {
                this.title_03_show = true;
            }


            var apiArr = map.get_cube_api(this.curCubeId);
            if (apiArr.length > 0) {
                this.title_04_show = true;
            }

            var reqArr = map.get_api_info_request(this.curCubeId);
            if (reqArr.length > 0) {
                this.title_05_show = true;
            }




            

            if (_.indexOf(collapse_cube_id_arr, this.curCubeId.toString()) > -1) {
                this.title_02_show = true;
                this.title_03_show = false;
                this.title_04_show = false;
                this.title_05_show = false;
            }

        }
    });


    Vue.component('m-cube-collection', vueComponent); //都全局注册 同时exports

    module.exports = vueComponent;
});